Skip to content

[Common] Add calculateWidth#92

Merged
TaerangLee merged 3 commits intodevelopfrom
feature/widthHook
Nov 26, 2023
Merged

[Common] Add calculateWidth#92
TaerangLee merged 3 commits intodevelopfrom
feature/widthHook

Conversation

@frorong
Copy link
Copy Markdown
Contributor

@frorong frorong commented Nov 26, 2023

개요 💡

�window의 width를 가져올 수 있는 hook을 제작했습니다.

작업내용 ⌨️

  • zustand 의존성을 추가했습니다.
  • useWidthState를 추가했습니다.
  • useWindowResizeEffect를 추가했습니다.

useWindowResizeEffect 사용법.

const { width } = useWidthState();

useWindowResizeEffect();

위와 같이 선언 시 window의 width가 변경됨에 따라 자동으로 변경된 width를 가져와 사용할 수 있습니다.
꼭 로직을 이해하고 사용하세요.!!!

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stack-knowledge-admin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2023 3:12pm
stack-knowledge-client ✅ Ready (Inspect) Visit Preview Nov 26, 2023 3:12pm

@TaerangLee TaerangLee merged commit cc69a80 into develop Nov 26, 2023
@TaerangLee TaerangLee deleted the feature/widthHook branch November 26, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants